<?php
namespace Modules\Admin\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\Goods;
use Illuminate\Support\Facades\Log;

class IndexController extends Controller{
    //查询商品销量前十名
    public function goodsSellNumByTenApi(){
        try{
            $goods = Goods::orderBy("sell_num","desc")->limit(10)->get();
            return self::success($goods);
        }catch (\Exception $e){
            Log::error($e);
            return self::error(500);
        }
    }

}